package me.itsoo.artemis.framework.core.converter.number;

import me.itsoo.artemis.framework.core.collect.ImmutableMap;
import me.itsoo.artemis.framework.core.converter.TypeConvertor;

import java.math.BigDecimal;
import java.math.BigInteger;
import java.util.Map;

/**
 * NumberTypeConvertor
 *
 * @author zxy
 * @version 0.0.1
 * @since 2023/5/29
 */
public interface NumberTypeConvertor extends TypeConvertor {

    /**
     * Number 类型转换器
     */
    Map<Class<?>, NumberTypeConvertor> TYPE_CONVERTORS = ImmutableMap.<Class<?>, NumberTypeConvertor>builder()
            .put(Byte.class, new ByteTypeConvertor())
            .put(byte.class, new ByteTypeConvertor())
            .put(Short.class, new ShortTypeConvertor())
            .put(short.class, new ShortTypeConvertor())
            .put(Integer.class, new IntegerTypeConvertor())
            .put(int.class, new IntegerTypeConvertor())
            .put(Long.class, new LongTypeConvertor())
            .put(long.class, new LongTypeConvertor())
            .put(Float.class, new FloatTypeConvertor())
            .put(float.class, new FloatTypeConvertor())
            .put(Double.class, new DoubleTypeConvertor())
            .put(double.class, new DoubleTypeConvertor())
            .put(BigInteger.class, new BigIntegerTypeConvertor())
            .put(BigDecimal.class, new BigDecimalTypeConvertor())
            .build();

}
